const crypto = require("crypto");
const { cryptoKey } = require("../config/config.default");

// 获取所有支持的哈希算法
/* console.log(crypto.getHashes());
const ret = crypto.createHash("md5").update("123456").digest("hex");
console.log("🚀 ~ ret:", ret); */

module.exports = (str) => {
  return crypto
    .createHash("md5")
    .update(cryptoKey + str)
    .digest("hex");
};
